<template>
  <div>
    <p>请选择你喜欢的栏目</p>
    <span v-for="(value, index) in arr" :key="index">
      <!-- 将数据绑定在新的数组   -->
      <input type="checkbox" :value="value" v-model="newarr" />
      {{ value }}</span
    >
    <ul>
      <li v-for="(value, index) in newarr" :key="index">{{ value }}</li>
    </ul>
  </div>
</template>

<script>
export default {
  data() {
    return {
      arr: ["科幻", "喜剧", "动漫", "冒险", "科技", "军事", "娱乐", "奇闻"],
      newarr: [],
    };
  },
};
</script>

<style>
</style>